﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BastContentList.ascx.cs" Inherits="Job.Web.userControls.Admin.BastContentList" %>
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
<script language="javascript" type="text/javascript">
    function CheckAll(select, indexStr) {
        
        var obj = document.documentElement.getElementsByTagName("input");
        if (obj != null && obj.length > 0) {
            for (i = 0; i < obj.length; i++) {
                var controlId = obj[i].id;
                if (indexStr != "") {
                    if (obj[i].type == 'checkbox' && controlId.indexOf(indexStr) >= 0) {
                        var disabled = obj[i].disabled;

                        if ((disabled == null || disabled == false)) {
                            obj[i].checked = select;
                        }
                    }
                }
                else {
                    if (obj[i].type == 'checkbox') {
                        var disabled = obj[i].disabled;

                        if ((disabled == null || disabled == false)) {
                            obj[i].checked = select;
                        }
                    }
                }
            }
        }
    }
</script>


<asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" 
    BackColor="White" BorderColor="#7070ff" BorderStyle="Solid" BorderWidth="1px" 
    CellPadding="3" GridLines="Horizontal" 
    onrowdatabound="GridView1_RowDataBound" 
    onselectedindexchanged="gvList_SelectedIndexChanged" Width="100%">    
    <SelectedRowStyle BackColor="#0000ff" />
    <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
    <EmptyDataTemplate>
        <asp:Label>该类别下无记录...</asp:Label>
    </EmptyDataTemplate>
    <Columns>
        <asp:TemplateField HeaderStyle-CssClass="table_font_td" ItemStyle-CssClass="table_font_td">
            <HeaderTemplate>
                <asp:CheckBox ID="chkAll" runat="server" onclick="CheckAll(this.checked,'')"/>
            </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="chkOne" runat="server" />
            </ItemTemplate>
            <HeaderStyle CssClass="table_font_td" />
            <ItemStyle Width="4%" />
        </asp:TemplateField>
        <asp:BoundField DataField="title" HeaderText="内容标题">
            <HeaderStyle HorizontalAlign =Center CssClass="table_font_td" />
            <ItemStyle HorizontalAlign="Left" CssClass="table_font_td" />
        </asp:BoundField>
        
        <asp:BoundField DataField="count" HeaderText="最击次数" >
            <HeaderStyle CssClass="table_font_td" />
            <ItemStyle Width="10%" CssClass="table_font_td" />
        </asp:BoundField>
        <asp:TemplateField HeaderText="最后更新" HeaderStyle-CssClass="table_font_td" ItemStyle-CssClass="table_font_td">
            <ItemTemplate>
                <asp:Label ID="lblLastUpdate" runat="server"></asp:Label>
            </ItemTemplate>
            <ItemStyle Width="30%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="状态" HeaderStyle-CssClass="table_font_td" ItemStyle-CssClass="table_font_td">
            <ItemTemplate>
                <asp:Label ID="lblStatustext" runat="server"></asp:Label>
            </ItemTemplate>
            <ItemStyle Width="8%" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="编辑">
                    <ItemTemplate>
                <asp:HyperLink ID="hlDetail" runat="server">配置</asp:HyperLink>
            </ItemTemplate>
                    <ItemStyle Width="5%" />
        </asp:TemplateField>
        <asp:TemplateField Visible="false">
            <ItemTemplate>
                <asp:Label ID="lblContentId" runat="server" Text ='<%# Bind("Content_Id")%>'></asp:Label>
                <asp:Label ID="lblLastDate" runat="server" Text ='<%# Bind("Last_Update_Time","{0:yyyy-MM-dd HH:mm:ss}") %>'></asp:Label>
                <asp:Label ID="lblLastUser" runat="server" Text ='<%# Bind("Last_Update_User") %>'></asp:Label>
                <asp:Label ID="lblStatus" runat="server" Text ='<%# Bind("Status_Id") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle Width="5%" />
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
    <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
    <AlternatingRowStyle BackColor="#F7F7F7" />
</asp:GridView>
<webdiyer:AspNetPager ID="pagerButtom" runat="server" ButtonImageNameExtension="n" ButtonImageExtension=".gif" 
        DisabledButtonImageNameExtension="g" CpiButtonImageNameExtension="r" 
		PagingButtonSpacing="10px" ButtonImageAlign="left" 
		onpagechanged="pagerButtom_PageChanged" CssClass="pagination" 
		CurrentPageButtonClass="current" PagingButtonClass="" 
		PagingButtonLayoutType="Span"
        PageSize="10">
</webdiyer:AspNetPager>
<br />
    <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text=" 新增记录 "  CssClass="btn_2k3"/>
    &nbsp;
    <asp:Button ID="btnDelete" runat="server" Text=" 删除记录 " onclick="btnDelete_Click"  CssClass="btn_2k3" />
    
    <br />										  
